{include 'admin/layout/header_list'}
<link rel="stylesheet" href="__ADMIN_STATIC__/css/addContent.css?random={extendSetting('random')}">
<div class="addcontent">
    <form class="ajaxForm" method="post" >
        <input type="hidden" name="_method" value="post">
        <table class="table">
            <tr>
                <td class="tl">
                    <span><strong>* </strong>单页标题</span>
                </td>
                <td>
                    <input class="long" name="title" type="text" >
                    <input type="color" name="color" style="width:30px;padding: 0;margin: 0" value="#000000" style="width:85%;">
                    <select name="level" >
                        <option value="">级别</option>
                        {foreach  [1,2,3,4,5,6,7,8,9] $key $val}
                        <option value="{$key}">{$val}级</option>
                        {/foreach}
                    </select>
                    <input  id="isLink" name="isLink" type="checkbox"   onclick="switchIsLink()">外部链接
                </td>
            </tr>
            <tr>
                <td class="isLink1 tl">
                    <span><strong>* </strong>外部链接</span>
                </td>
                <td>
                    <input class="long"  name="linkUrl">
                </td>
            </tr>
            <tr>
                <td class="isLink0 tl">
                    <span><strong>* </strong>单页内容</span>
                </td>
                <td>
                    {include 'admin/layout/file_editor_load'}
                    <textarea name="content" id="content" style="width: 100%; height: 300px;"></textarea>
                </td>
            </tr>
            <tr>
                <td class="isLink0 tl">
                    <span><strong></strong>绑定域名</span>
                </td>
                <td>
                    <input class="long" name="domain" type="text" placeholder="可空,不填写为当前域名" >
                </td>
            </tr>
            <tr>
                <td class="isLink0 tl">
                    <span><strong></strong>保存路径</span>
                </td>
                <td>
                    <input class="midium" name="path" type="text" value="" >根目录可以空，否则请以‘/’开头结尾，例如‘/about/’
                </td>
            </tr>
            <tr>
                <td class="isLink0 tl">
                    <span><strong></strong>文件名称</span>
                </td>
                <td>
                    <input class="midium" name="file" type="text" value="{id}.html" >如不填写则自动按ID生成文件名，例如‘1.html’ 支持变量{id}=单页id, 如 singlePage-{id}.html
                </td>
            </tr>

            <tr>
                <td class="isLink0 tl">
                    <span><strong></strong>seo标题</span>
                </td>
                <td>
                    <input class="long" name="seoTitle" type="text" >
                </td>
            </tr>
            <tr>
                <td class="isLink0 tl">
                    <span><strong></strong>seo关键字</span>
                </td>
                <td>
                    <input class="long" name="seoKeywords" type="text" >
                </td>
            </tr>
            <tr>
                <td class="isLink0 tl">
                    <span><strong></strong>SEO描述</span>
                </td>
                <td>
                    <input class="long" name="seoDescription" type="text" >
                </td>
            </tr>
            <tr>
                <td class="tl">
                    <span><strong></strong>分组标识</span>
                </td>
                <td>
                    <select  name="item" class="midium">
                        <option value="">选择分组标识</option>
                        {if $group}
                        {foreach $group $key $val}
                        <option value="{$key}" >{$val}</option>
                        {/foreach}
                        {/if}
                    </select>
                    单页的分组标识，如果不理解含义，请勿修改
                </td>
            </tr>
            <tr>
                <td class="tl">
                    <span><strong></strong>选择模板</span>
                </td>
                <td>
                    <select name="template" class="midium">
                        <option value="">默认模板</option>
                        {if isset($settingData["templateFiles"]['singlePage']) && $settingData["templateFiles"]['singlePage']}
                        {foreach $settingData["templateFiles"]['singlePage'] $key $val}
                        <option value="{$key}">{$val}</option>
                        {/foreach}
                        {/if}
                    </select>
                </td>
            </tr>

        </table>
        <div class="ltcms-button">
            <button class="btns submit ajaxBtn" type="button" data-submit-url="{LTCMS_ROUTE_PREFIX}/singlePage" data-form=".ajaxForm" data-location-url="{LTCMS_ROUTE_PREFIX}/singlePage/index"  data-close="5" >保存并提交</button>
            <button class="btns cancel">取消并返回</button>
        </div>
    </form>
</div>
<script src="__ADMIN_STATIC__/js/addContent.js?random={extendSetting('random')}"></script>
<script  >
    function switchIsLink(){
        let isChecked =  $('#isLink').prop('checked');
        if (isChecked){
            $(".isLink0").parent().hide()
            $(".isLink1").parent().show()
        }else {
            $(".isLink0").parent().show()
            $(".isLink1").parent().hide()
        }

    }
    switchIsLink()

</script>
{include 'admin/layout/file_upload_script_auto'}
{include 'admin/layout/footer'}